<!DOCTYPE html>
<!--头部公共部分-->
{include file="common/header" /}

<div  class="x-body" class="clear:both;">
        <table class="layui-hide" id="LAY_table_user" lay-filter="Event"></table>
</div>

<!--底部公共部分-->
{include file="common/footer" /}
<script>
    layui.use(['form', 'element', 'table','laydate', 'layer', 'laytpl'], function () {
        var $ = layui.$,
            form = layui.form,
            table = layui.table,
            laydate = layui.laydate,
            element = layui.element,
            layer = layui.layer;

        var loading = layer.load();
        var course_name = '{$course_name}';
        var course_id = '{$course_id}';
        var start_date = '{$start_date}';
        var end_date = '{$end_date}';
        var campus_id = '{$campus_id}';
        //数据表格 方法级渲染
        var tableIns = table.render({
            elem: '#LAY_table_user'
            , url: '{:url("elimination/geteliminationlists")}?course_id=' + course_id + '&start_date=' + start_date + "&end_date=" + end_date + "&campus_id=" + campus_id
            , method: 'POST'
            , toolbar: 'true' //开启工具栏，此处显示默认图标，可以自定义模板，详见文档
            , defaultToolbar: ['print', 'exports'] // 筛选图标
            , loading: true
            , parseData: function (res) { //res 即为原始返回的数据
                if (res.code === 1) {
                    res.code = 0;
                } else {
                    res.code = -1;
                }
                return {
                    "code": res.code, //解析接口状态
                    "msg": res.message, //解析提示文本
                    "count": res.data.total, //解析数据长度
                    "data": res.data.data //解析数据列表
                };
            },
            cols: [[
                {field: 'student_number', title: '学号',style:'font-weight: bold;', width: 200, align: 'center',templet: '#course_name'
                },{field: 'student_name', title: '学生姓名', style:'font-weight: bold;',width: 100, align: 'center'
                },{field: 'grade', title: '年级', style:'font-weight: bold;', width: 80, align: 'center'
                },{field: 'course_name', title: '课程',style:'font-weight: bold;', width: 300, align: 'center'
                },{field: 'class_grade', title: '班级名称',style:'font-weight: bold;', width: 200, align: 'center'
                },{field: 'teacher', title: '任课老师',style:'font-weight: bold;', width: 100, align: 'center'
                },{field: 'assistant', title: '助教',style:'font-weight: bold;', width: 100, align: 'center'
                },{field: 'headmaster', title: '班主任',style:'font-weight: bold;', width: 100, align: 'center'
                },{field: 'class_time', title: '上课时间',style:'font-weight: bold;', width: 200, align: 'center'
                },{field: 'status', title: '状态',style:'color:#ef4136;font-weight: bold;', width: 200, align: 'center'
                }
            ]]
            , height: 'full'
            , page: true
            , title: course_name+ '--课消报表'
            , limits: [10,20,30,40,50,60,70,80,90,10000000]
            , done: function () {
                layer.close(loading);
            }
        });

    });
</script>

